package ynu.edu.feign.fallback;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import ynu.edu.entities.BaseResponse;
import ynu.edu.entities.Order;
import ynu.edu.feign.OrderServiceClient;

/**
 * 订单服务降级处理类
 */
@Slf4j
@Component
public class OrderServiceFallback implements OrderServiceClient {
    
    @Override
    public BaseResponse<Order> getOrderById(Integer orderId) {
        log.error("获取订单信息失败，订单ID：{}", orderId);
        return BaseResponse.error("获取订单信息失败，服务暂不可用");
    }
    
    @Override
    public BaseResponse<Void> updateOrderState(Integer orderId, Integer orderState) {
        log.error("更新订单状态失败，订单ID：{}，状态：{}", orderId, orderState);
        return BaseResponse.error("更新订单状态失败，服务暂不可用");
    }
    
    @Override
    public BaseResponse<Void> updateOrderStatePost(Integer orderId, Integer orderState) {
        log.error("POST方法更新订单状态失败，订单ID：{}，状态：{}", orderId, orderState);
        return BaseResponse.error("更新订单状态失败，服务暂不可用");
    }
} 